package com.spa.infrastructure.enums.dict;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "CityStatus", desc = "城市状态")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CityStatusEnum implements IBaseEnum {

    $10(10, "运营中",1,0),
    $20(20, "已下线",2,0),
    ;
    private Integer code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;

    public static CityStatusEnum byCode(int code) {
        for (CityStatusEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
